<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Faq extends MY_Controller {

     function __construct() {
        parent::__construct();
        $this->load->helper('url');
        $this->load->library('parser');
        //$this->template->set_template('home');
        $this->template->add_region('new_tours');
        $this->load->model('introdution_model', 'about', true);
        
        //$this->template->write('total_online',  $counter['online']);
       
     }

    function index($id = 0) {
        $this->view($id);
    }

    function view($id) {

        $id = intval($id);
        if($id)
            $data = $this->about->getById($id);
        else
             $data = $this->about->getNewest();
        
        $data['site_url'] = site_url();

        $offset = 0;
        $number_record = 20;
        $active = 1;
        $data['abouts'] = $this->about->getAll($offset, $number_record, $active);
        for($i = 0; $i < count($data['abouts']); $i++){
            $tmp = $data['abouts'][$i];
        }
        
        $this->template->parse_view('left_menu', 'default/front_end/about/about_menu', $data);
        $this->template->parse_view('content', 'default/front_end/about/view_about', $data);
        $this->template->render();
    }

    function index1($var = 1212){
        echo 'call index1. var =' . $var;
    }

    function buildLeftContent() {
        $data['menuitems'] = array(
            array(
                'status' => 'active',
                'click_function' => 'get_list(current_from, this);',
                'text' => 'Add New Child',
                'href' => site_url('children/add_child'),
                'subitem' => array('a' => 'a')
            ),
            array(
                'status' => '',
                'click_function' => 'create_user(this);',
                'text' => 'View All Children ',
                'href' => site_url('children/view_all'),
                'subitem' => array('a' => 'a')
            ),
            array(
                'status' => '',
                'click_function' => 'system_logs(this);',
                'text' => 'View Current Children ',
                'href' => site_url('children/view_current'),
                'subitem' => array('a' => 'a')
            ),
            array(
                'status' => '',
                'click_function' => 'login_logs(this);',
                'text' => 'View Graduated Children ',
                'href' => site_url('children/view_graduated'),
                'subitem' => array('a' => 'a')
            ),
            array(
                'status' => '',
                'click_function' => 'system_config(this);',
                'text' => 'View Withdrawn Children ',
                'href' => site_url('children/view_withdraw'),
                'subitem' => array('a' => 'a')
            )
        );
        $this->load->library('parser');
        $this->parser->parse('default/front_end/menu_left', $data);
        $this->template->parse_view('header', 'default/front_end/menu_left', $data);
    }

}

?>